public class Test {

    /*//定义类型

        //成员变量
        public int age;
        public String name;
        public String gender;

        //成员方法
        public void setDog(int age, String name, String gender) {
            this.age = age;
            this.name = name;
            this.gender = gender;
        }

        public void eat() {
            System.out.println(name + "吃......");
        }

        public void sleep() {
            System.out.println(name + "睡觉......");
        }

        public void smile(){
            System.out.println("微笑......");
        }

        //构造方法


        public void Print() {
            System.out.println(age + name + gender);
        }

    public static void main(String[] args) {
        Test dog1 = new Test();
        Test dog2 = new Test();
        *//*dog1.age = 1;
        dog1.name = "s";
        dog1.gender = "male";*//*
        dog1.setDog(2, "z", "female");
        dog1.eat();
        dog1.sleep();
        dog1.smile();

        dog2.setDog(1, "u", "male");
        dog1.Print();
        dog2.Print();
    }*/

    public int year;
    public int month;
    public int day;

    public void setDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void printDate(){
        System.out.println(year + "年" + month + "月" + day + "日");
    }

    public static void main(String[] args) {
        Test date1 = new Test();
        date1.year = 2000;
        date1.month = 1;
        date1.day = 1;
        date1.printDate();

        Test date2 = new Test();
        date2.year = 2023;
        date2.month = 3;
        date2.day = 3;
        date2.printDate();

        Test date3 = new Test();
        date3.setDate(2024,5,29);
        date3.printDate();
    }

}
